/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.usc.cs576.mediaoctopusplayer.test;

import java.io.IOException;
import java.net.URISyntaxException;
import java.util.logging.Level;
import java.util.logging.Logger;

public class OpenURI {

    public static void main(String[] args) {
        try {
            if (!java.awt.Desktop.isDesktopSupported()) {
                System.err.println("Desktop is not supported (fatal)");
                System.exit(1);
            }
            java.awt.Desktop desktop = java.awt.Desktop.getDesktop();
            if (!desktop.isSupported(java.awt.Desktop.Action.BROWSE)) {
                System.err.println("Desktop doesn't support the browse action (fatal)");
                System.exit(1);
            }
            java.net.URI uri = new java.net.URI("http://www.google.com");
            desktop.browse(uri);
        } catch (IOException ex) {
            Logger.getLogger(OpenURI.class.getName()).log(Level.SEVERE, null, ex);
        } catch (URISyntaxException ex) {
            Logger.getLogger(OpenURI.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
